
const express = require('express')
const fs = require('fs')
const path = require('path')
const app = express()
const compression = require('compression')

function myReadFile(hash){
    return fs.readFileSync(path.join(__dirname,hash), 'utf-8')
}

app.use(compression());
app.use('/lib',express.static('./lib'))
app.get('/',(req,res)=>{
    let html = myReadFile('./swiper.html')
    res.send(html)
})
app.get('/load',(req,res)=>{
    let html = myReadFile('./load.html')
    res.send(html)
})
app.get('/jianli',(req,res)=>{
    let html = myReadFile('./jackshen\'sintroduce.html')
    res.send(html)
})

app.listen(80,'0.0.0.0',()=>{
    console.log('server running at http://localhost:80')
})